package cn.sinata.wanglin.village.activity;
import android.content.Intent;
import android.view.Gravity;
import android.view.View;
import android.widget.Button;

import com.xilada.xldutils.activitys.DialogActivity;
import com.xilada.xldutils.utils.ActivityUtil;

import cn.sinata.wanglin.R;

public class UserDetailMoreActivity extends DialogActivity implements View.OnClickListener {

    private String friendId=null;
    @Override
    protected int setContentLayout() {
        return R.layout.user_detail_more_popupwindow;
    }
    @Override
    protected int exitAnim() {
        return 0;
    }
    @Override
    protected void initView() {
        friendId=getIntent().getStringExtra("friendId");
        getWindow().setGravity(Gravity.BOTTOM);
        Button button1 = bind(R.id.button1);
        Button button2 = bind(R.id.button2);
        Button button3 = bind(R.id.button3);
        Button button4 = bind(R.id.button4);
        button1.setOnClickListener(this);
        button2.setOnClickListener(this);
        button3.setOnClickListener(this);
        button4.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.button1:
                //举报
                ActivityUtil.create(mContext).go(ReportActivity.class)
                        .put("friendId",friendId)
                        .startForResult(1);
            break;
            case R.id.button2:
                //屏蔽
                setResult(1);
                finish();
                break;
            case R.id.button3:
                //黑名单
                setResult(2);
                finish();
                break;
            case R.id.button4:
                //取消
                finish();
                break;
        }

    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if(resultCode==RESULT_OK){
            switch (requestCode){
                case 1:
                     finish();
                    break;
            }
        }
    }
}
